package com.karst.webnotes.chapter04
{
	import flash.display.Sprite;
	
	public class Chapter04Entry extends Sprite
	{
		public static const SECTION_LIST : Array = [1,2,3,4,5,6,7,8,9,10,11,12,13] ;
		
		public function Chapter04Entry()
		{
			super();
//			createView() ;
		}
		
		public function showSection( $section : int = 1 ) : void
		{
			while( numChildren )
				removeChildAt( 0 ) ;
			switch( $section )
			{
				case SECTION_LIST[0] :
					createSection01() ;
					break ;
				case SECTION_LIST[1] :
					createSection02() ;
					break ;
				case SECTION_LIST[2] :
					createSection03() ;
					break ;
				case SECTION_LIST[3] :
					createSection04() ;
					break ;
				case SECTION_LIST[4] :
					createSection05() ;
					break ;
				case SECTION_LIST[5] :
					createSection06() ;
					break ;
				case SECTION_LIST[6] :
					createSection07() ;
					break ;
				case SECTION_LIST[7] :
					createSection08() ;
					break ;
				case SECTION_LIST[8] :
					createSection09() ;
					break ;
				case SECTION_LIST[9] :
					createSection10() ;
					break ;
				case SECTION_LIST[10] :
					createSection11() ;
					break ;
				case SECTION_LIST[11] :
					createSection12() ;
					break ;
				case SECTION_LIST[12] :
					createSection13() ;
					break ;
				default :
					break ;
			}
		}

		private var wm : WmExample = null ;
		private function createSection01() : void
		{
			if( wm == null )
				wm = new WmExample() ;
			addChild( wm ) ;
		}
		
		private var bitmapMaterial : BitmapMaterialExample = null ;
		private function createSection02() : void
		{
			if( bitmapMaterial == null )
				bitmapMaterial = new BitmapMaterialExample() ;
			addChild( bitmapMaterial ) ;
		}
		
		private var bmpMatrialImg : BitmapMaterialImgExample = null ;
		private function createSection03() : void
		{
			if( bmpMatrialImg == null )
				bmpMatrialImg = new BitmapMaterialImgExample() ;
			addChild( bmpMatrialImg ) ;
		}
		
		private var bmpFileMaterial : BmpFileMaterialExample = null ;
		private function createSection04() : void
		{
			if( bmpFileMaterial == null )
				bmpFileMaterial = new BmpFileMaterialExample() ;
			addChild( bmpFileMaterial ) ;
		}
		
		private var bmpAssetMaterial : BmpAssetMaterialExample = null ;
		private function createSection05() : void
		{
			if( bmpAssetMaterial == null )
				bmpAssetMaterial = new BmpAssetMaterialExample() ;
			addChild( bmpAssetMaterial ) ;
		}
		
		private var movieMaterial : MovieMaterialExample = null ;
		private function createSection06() : void
		{
			if( movieMaterial == null )
				movieMaterial = new MovieMaterialExample() ;
			addChild( movieMaterial ) ;
		}
		
		private var videoMaterial : VideoMaterialExample = null ;
		private function createSection07() : void
		{
			if( videoMaterial == null )
				videoMaterial = new VideoMaterialExample() ;
			addChild( videoMaterial ) ;
		}
		
		private var compositeMaterial : CompositeMaterialExample = null ;
		private function createSection08() : void
		{
			if( compositeMaterial == null )
				compositeMaterial = new CompositeMaterialExample() ;
			addChild( compositeMaterial ) ;
		}
		
		private var do3d : Do3dInteractiveExample = null ;
		private function createSection09() : void
		{
			if( do3d == null )
				do3d = new Do3dInteractiveExample() ;
			addChild( do3d ) ;
		}
		
		private var tiling : TilingMaterialExample = null ;
		private function createSection10() : void
		{
			if( tiling == null )
				tiling = new TilingMaterialExample() ;
			addChild( tiling ) ;
		}
		
		private var flipMaterial : FlipMaterialExample = null ;
		private function createSection11() : void
		{
			if( flipMaterial == null )
				flipMaterial = new FlipMaterialExample() ;
			addChild( flipMaterial ) ;
		}
		
		private var flipMaterial2 : FlipMaterialExample2 = null ;
		private function createSection12() : void
		{
			if( flipMaterial2 == null )
				flipMaterial2 = new FlipMaterialExample2() ;
			addChild( flipMaterial2 ) ;
		}
		
		private var finalMaterial : FinalMaterial = null ;
		private function createSection13() : void
		{
			if( finalMaterial == null )
				finalMaterial = new FinalMaterial() ;
			addChild( finalMaterial ) ;
		}
		
		private function createView() : void
		{

		}
	}
}